<?php
defined('IN_PHPCMS') or exit('No permission resources.'); 
/**  
 * 点击统计  
 */  
$db = '';  
$db = pc_base::load_model('page_model'); //引入单页面模型 
if($_GET['modelid'] ==0){    //单页面的modelid为 
    if($_GET['catid']) {     //获取当前栏目id 
        $catid = intval($_GET['catid']);  
        $r = $db->get_one(array('catid'=>$catid));   
        $views = $r['hits'];  
        $views = $views + 1;  
        $sql = array('hits'=>$views);  
        $db->update($sql, array('catid'=>$catid));//更新点击次数并存放   
    }   
}else{  
  echo ("模型id传递错误");  
}  
?>  
$('#hits').html('<?php echo $views;?>');  
